1. Field of the invention
The present invention relates to a compression device for compressing still color image data in accordance with a JPEG (Joint Photographic Expert Group) algorithm, and an expansion device for expanding the compressed image data to reproduce the still image.
2. Description of the Related Art
A standard algorithm, for encoding of a still image and transfer of the encoded image through telecommunication transmission channels, has been recommended by the JPEG. In order to enable a large-scale data compression, a baseline process of the JPEG algorithm breaks down original image data into components on a spatial frequency axis by using a two-dimensional discrete cosine transformation (DCT) process. Thereafter, data expressed on the spatial frequency axis is quantized using a quantization table. The quantized data is then encoded, using a Huffman table.
The encoded (or compressed) image data can be expanded by carrying out a process, which is the inverse of the compression process described above, so that the original image data can be reproduced. Namely, the compressed image data is decoded, is subjected to a dequantization process by using the quantization table, and is, finally, subjected to a two-dimensional inverse discrete cosine transformation (IDCT) process, so that the original data is reproduced.
However, since the JEPG algorithm, which is a lossy (unreversible) encoding and decoding process, cannot reproduce the original still image identically, because of the quantization process and dequantization process, picture quality of the reproduced image drops in comparison with that of the original image.
On the other hand, a lossless (reversible) encoding and decoding process, for example, a spatial predictive encoding and decoding process, can reproduce the original image identically. However, this compression process cannot compress a high-resolution image efficiently.
Accordingly, an object of the present invention is to provide an image compression and expansion device, that compresses a high-resolution image efficiently and expands compressed image data to reproduce the original image, while suppressing a degradation in picture quality.
An image compression device according to the present invention comprises an orthogonal transformation processor, a determiner, a calculator, a bit separation processor, a sign bit addition processor, a grouping processor, and an encoding processor.
The orthogonal transformation processor applies an orthogonal transformation to image data corresponding to a still image to obtain orthogonal transformation coefficients. The determiner determines whether a sign of each of the orthogonal transformation coefficients expressed as a bit sequence is negative. The calculator manipulates the bit sequence to reverse the sign, when the sign is negative. The bit separation processor separates either the bit sequence, when the sign of the orthogonal transformation coefficient is positive, or the manipulated bit sequence, when the sign of the orthogonal transformation coefficient is negative, to a higher-rank bit sequence and a lower-rank bit sequence to obtain a higher-rank orthogonal transformation coefficient and a lower-rank orthogonal transformation coefficient. The sign bit addition processor adds either an additional positive-sign bit to the lower-rank bit sequence, when the orthogonal transformation coefficient is positive, or an additional negative-sign bit to the lower-rank bit sequence when the orthogonal transformation coefficient is negative, to obtain a sign-included lower-rank orthogonal transformation coefficient. The grouping processor utilizes a group table to obtain zero run lengths, group numbers and added bits of the higher-rank orthogonal transformation coefficients. The encoding processor utilizes a Huffman table to determine a codeword corresponding to each of the zero run lengths and the group numbers, and combines the added bits and the codeword to generate compressed image data.
Further, an image compression and expansion device according to the present invention comprises an orthogonal transformation processor, a determiner, a calculator, a bit separation processor, a sign bit addition processor, a grouping processor, an encoding processor, a decoding processor, an inverse grouping processor, a bit synthesis processor, an inverse determiner, an inverse calculator, and an inverse orthogonal transformation processor.
The orthogonal transformation processor applies an orthogonal transformation to image data corresponding to a still image to obtain orthogonal transformation coefficients. The determiner determines whether a sign of each of the orthogonal transformation coefficients expressed as a bit sequence is negative. The calculator manipulates the bit sequence to reverse the sign, when the sign is negative. The bit separation processor separates either the bit sequence, when the sign of the orthogonal transformation coefficient is positive, or the manipulated bit sequence when the sign of the orthogonal transformation coefficient is negative, to a higher-rank bit sequence and a lower-rank bit sequence to obtain a higher-rank orthogonal transformation coefficient and a lower-rank orthogonal transformation coefficient. The sign bit addition processor adds either an additional positive-sign bit to the lower-rank bit sequence, when the orthogonal transformation coefficient is positive, or an additional negative-sign bit to the lower-rank bit sequence, when the orthogonal transformation coefficient is negative, to obtain a sign-included lower-rank orthogonal transformation coefficient. The grouping processor utilizes a group table to obtain zero run lengths, group numbers and added bits of the higher-rank orthogonal transformation coefficients. The encoding processor utilizes the Huffman table to determine a codeword corresponding to each of the zero run lengths and the group numbers, and combines the added bits and the codeword to generate compressed image data. The decoding processor utilizes a Huffman table to obtain the zero run lengths and the group numbers corresponding to the codewords from the compressed data. The inverse grouping processor utilizes the group table to reproduce the higher-rank orthogonal transformation coefficients, based on the zero run lengths, the group numbers and the added bits. The bit synthesis processor synthesizes the higher-rank bit sequence and the lower-rank bit sequence reproduced from the reproduced higher-rank orthogonal transformation coefficients to obtain the orthogonal transformation coefficients expressed as either the manipulated bit sequence or the bit sequence. The inverse determiner determines whether the sign-included lower-rank orthogonal transformation coefficient, corresponding to the lower-rank orthogonal transformation coefficient being subjected to the synthesis of the bit synthesis processor, has the additional negative-sign bit. The inverse calculator manipulates the manipulated bit sequence to reverse a sign of the corresponding reproduced orthogonal transformation coefficient when the sign-included lower-rank orthogonal transformation coefficient has the additional negative-sign bit. The inverse orthogonal transformation processor applies an inverse orthogonal transformation to the reproduced orthogonal transformation coefficients to obtain the image data corresponding to the still image.
An image expansion device according to the present invention comprises a decoding processor, a bit synthesis processor, a determiner, a calculator, and inverse orthogonal transformation, which expands compressed data composed of first data and second data. The first data are, for example, generated by an orthogonal transformation, bit separation processing and entropy encoding, and correspond to higher-rank orthogonal transformation coefficients. The second data are, for example, composed of sign bit data, which indicates a positive or negative, and separation data, which is generated by the bit separation processing and expressed as a bit sequence.
The decoding processor decodes the first data by an entropy decoding process to obtain the higher-rank orthogonal transformation coefficients expressed as higher-rank bit sequences. The bit synthesis processor synthesizes the higher-rank bit sequence of each of the higher-rank orthogonal transformation coefficients and the lower-rank bit sequence of the corresponding separation data to obtain orthogonal transformation coefficients. The determiner determines whether the sign bit data, which is corresponding to the separation data being subjected to a synthesis of the bit synthesis processor, is negative. The calculator reverses a sign of the orthogonal transformation coefficients when the corresponding sign bit data is negative. The inverse orthogonal transformation processor applies the orthogonal transformation coefficients to obtain image data corresponding to a still image.
An image compression device according to the present invention comprises an orthogonal transformation processor, a bit separation processor, a grouping processor, and an encoding processor.
The orthogonal transformation processor applies an orthogonal transformation to image data corresponding to a still image to obtain orthogonal transformation coefficients expressed as bit sequences. The bit separation processor separates each bit sequence to a higher-rank bit sequence and a lower-rank bit sequence to obtain a higher-rank orthogonal transformation coefficient and a lower-rank orthogonal transformation coefficient. The grouping processor utilizes a group table to obtain zero run lengths, group numbers and added bits of the higher-rank orthogonal transformation coefficients. The encoding processor utilizes a Huffman table to determine a codeword corresponding to each of the zero run lengths and the group numbers, and combines the added bits and the codeword to generate compressed image data.
Further, an image compression and expansion device comprises an orthogonal transformation processor, a bit separation processor, a grouping processor, an encoding processor, a decoding processor, an inverse grouping processor, a bit synthesis processor, and an inverse orthogonal transformation processor.
The orthogonal transformation processor applies an orthogonal transformation to image data corresponding to a still image to obtain orthogonal transformation coefficients expressed as bit sequences. The bit separation processor separates each bit sequence to a higher-rank bit sequence and a lower-rank bit sequence to obtain a higher-rank orthogonal transformation coefficient and a lower-rank orthogonal transformation coefficient. The grouping processor utilizes a group table to obtain zero run lengths, group numbers and added bits of the higher-rank orthogonal transformation coefficients. The encoding processor utilizes a Huffman table to determine a codeword corresponding to each of the zero run lengths and the group numbers, and combines the added bits and the codeword to generate compressed image data. The decoding processor utilizes the Huffman table to obtain the zero run lengths and the group numbers corresponding to the codewords from the compressed data. The inverse grouping processor utilizes the group table to reproduce the higher-rank orthogonal transformation coefficients, based on the zero run lengths, the group numbers and the added bits. The bit synthesis processor synthesizes the higher-rank bit sequence reproduced from the reproduced higher-rank orthogonal transformation coefficients and the lower-rank bit sequence reproduced by removing the additional negative-sign bit or additional positive-sign bit from the sign-included lower-rank orthogonal transformation coefficients to obtain the orthogonal transformation coefficients expressed as the bit sequences. The inverse orthogonal transformation processor applies an inverse orthogonal transformation to the reproduced orthogonal transformation coefficients to obtain the image data corresponding to the still image.
An image expansion device according to the present invention comprises a decoding processor, a bit synthesis processor, and an inverse orthogonal transformation processor, which expands compressed image data composed of first data and second data. The first data are, for example, generated by an orthogonal transformation, a bit separation processing and an entropy encoding, and correspond to higher-rank orthogonal transformation coefficients. The second data, expressed as lower-rank bit sequences, are, for example, generated by the bit separation processing, and correspond to lower-rank orthogonal transformation coefficients.
The decoding processor decodes the first data by an entropy decoding process to obtain the higher-rank orthogonal transformation coefficients expressed as higher-rank bit sequences. The bit synthesis processor synthesizes the higher-rank bit sequence of each of the higher-rank orthogonal transformation coefficients and the lower-rank bit sequence of the corresponding second data to obtain orthogonal transformation coefficients. The inverse orthogonal transformation processor applies an inverse orthogonal transformation to the orthogonal transformation coefficients to obtain image data corresponding to a still image.